﻿<%@ Page Language="C#" MasterPageFile="~/Themes/Default/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="content" ContentPlaceHolderID="MainContent" runat="server">

<h2 class="MvcMembership">Create User</h2>
<h3 class="MvcMembership"><% =Html.ActionLink( "<< Return to Membership Administration", "Index", "MembershipAdministration" )%></h3>

<% using( Html.BeginForm( "SaveNewUser", "MembershipAdministration" ) ){ %>

	<fieldset class="MvcMembership">
		<legend>Create User</legend>

		<% if( TempData["MembershipCreateStatus"] != null ){ %>
		<div class="errorMessage">
		<% =TempData["MembershipCreateStatus"].ToString() %>
		</div>
		<% } %>

		<div>
		<label for="MembershipUser.UserName">User Name</label>
		<% =Html.TextBox( "MembershipUser.UserName", (string)TempData["MembershipUser.UserName"] ?? "", new { size = 32, maxlength = 256 } ) %>
		</div>

		<div>
		<label for="MembershipUser.Password">Password</label>
		<% =Html.Password( "MembershipUser.Password", null, new { size = 32 } ) %>
		</div>

		<div>
		<label for="MembershipUser.ConfirmPassword">Confirm Password</label>
		<% =Html.Password( "MembershipUser.ConfirmPassword", null, new { size = 32 } )%>
		</div>

		<div>
		<label for="MembershipUser.EmailAddress">Email Address</label>
		<% =Html.TextBox("MembershipUser.EmailAddress", (string)TempData["MembershipUser.EmailAddress"] ?? "", new { size = 32, maxlength = 285 })%>
		</div>

		<% if (ViewData["RequiresQuestionAndAnswer"] != null && (bool)ViewData["RequiresQuestionAndAnswer"] ) { %>
		<div>
		<label for="MembershipUser.PasswordQuestion">Password Question</label>
		<% =Html.TextBox("MembershipUser.PasswordQuestion", (string)TempData["MembershipUser.PasswordQuestion"] ?? "", new { size = 32, maxlength = 128})%>
		</div>

		<div>
		<label for="MembershipUser.PasswordAnswer">Password Answer</label>
		<% =Html.TextBox("MembershipUser.PasswordAnswer", (string)TempData["MembershipUser.PasswordAnswer"] ?? "", new { size = 32, maxlength = 128})%>
		</div>
		<% } %>

		<div>
		<label for="MembershipUser.IsApproved">Is Approved</label>
		<input type="checkbox" id="MembershipUser.IsApproved" name="MembershipUser.IsApproved" <% =bool.Parse( ( TempData["MembershipUser.IsApproved"] ?? true.ToString() ).ToString() ) ? "checked=\"checked\"" : "" %> />
		</div>

		<div><input type="submit" value="Create User" /></div>

	</fieldset>

<% } %>

</asp:Content>